﻿<ctrl:GuiControl x:Class="CannedBytes.CommandLineGui.UI.Controls.SelectTypeControl" x:ClassModifier="internal"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:ctrl="clr-namespace:CannedBytes.CommandLineGui.UI.Controls"
             mc:Ignorable="d"
             d:DesignHeight="30" d:DesignWidth="200"
             ToolTip="{Binding Description, Mode=OneTime}">

    <Grid Name="LayoutGrid">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
        </Grid.RowDefinitions>

        <Label Name="SelectTypeLabel" Content="{Binding Path=Name, Mode=OneTime}"/>

        <ComboBox Name="TypeList"
                  ItemsSource="{Binding Path=Types, Mode=OneWay, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ctrl:SelectTypeControl}}"
                  IsTextSearchEnabled="True"
                  IsSynchronizedWithCurrentItem="true"
                  SelectionChanged="TypeList_SelectionChanged"
                  Grid.Column="1">

            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding FullName, Mode=OneTime}" ToolTip="{Binding FullyQualifiedName, Mode=OneTime}" />
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>

        <Button Grid.Column="2" Click="Button_Click" ToolTip="Browse to an Assembly.">
            <Image Source="/CannedBytes.CommandLineGui;component/Resources/Export File.png" />
        </Button>
    </Grid>
</ctrl:GuiControl>